package com.lyf.scm.admin.domain.remote.allocationservice;

import com.github.pagehelper.PageInfo;
import com.lyf.scm.admin.api.dto.*;
import com.lyf.scm.admin.api.dto.es.SalesPlanEsEntity;
import com.lyf.scm.admin.domain.excel.dto.SalesWriteDTO;
import com.rome.arch.core.clientobject.Response;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * description:
 * 其他渠道计划
 *
 * @author: huangtao
 * @data: 2020/7/31
 */
@FeignClient(name = "scm-plan-service")
public interface SalesPlanOtherRemote {

    /**
     * 按条件查询其他渠道计划(周)
     *
     * @param salesPlanOther
     * @return
     */
    /*@PostMapping("/api/v1/salesPlanOther/listWeek")
    Response<PageInfo<SalesPlanOtherInfoDTO>> listWeekBySelective(@RequestBody SalesPlanOtherDTO salesPlanOther);

    *//**
     * 查询全渠道其他渠道计划(范围)
     *
     * @param salesPlanOther
     * @return
     *//*
    @PostMapping("/api/v1/salesPlanOther/listAllByCycles")
    Response<List<SalesPlanOtherInfoDTO>> listAllByCycles(@RequestBody SalesPlanOtherDTO salesPlanOther);*/

    /**
     * 手工导入
     *
     * @param dtos
     * @param impType
     * @param id
     * @return
     */
    @PostMapping("/api/v1/salesPlanOther/importPlanType")
    Response importPlanType(@RequestBody List<SalesPlanOtherDTO> dtos, @RequestParam("impType") Integer impType, @RequestParam("id") Long id);

    /**
     * 更新确认量
     *
     * @param all
     * @param unitType
     * @param level
     * @return
     */
    @PutMapping("/api/v1/salesPlanOther/confirm")
    Response<Boolean> confirm(@RequestBody List<SalesPlanOtherDTO> all, @RequestParam("unitType") Long unitType, @RequestParam("level") Integer level);

    /**
     * 其他渠道计划获取当前用户级别
     *
     * @param userId
     * @return
     */
    /*@PostMapping("/api/v1/salesPlanOther/getOtherPlanLevel")
    Response<Integer> getOtherPlanLevel(@RequestParam("userId") Long userId);*/

    /**
     * 导出
     *
     * @param salesPlanOtherDTO
     * @param type
     * @return
     */
    @PostMapping(value = "/api/v1/salesPlanOther/export", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    feign.Response export(@RequestBody SalesPlanOtherDTO salesPlanOtherDTO, @RequestParam("type") Integer type);

    /**
     * 导出模板
     *
     * @param type
     * @param date
     * @return
     */
    @PostMapping(value = "/api/v1/salesPlanOther/downLoadTemplate", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    feign.Response downLoadTemplate(@RequestParam("type") String type, @RequestParam("date") String date);

    /**
     * 删除对应标识的数据
     *
     * @param opSign
     * @return
     */
    @PostMapping("/api/v1/salesPlanOther/delete")
    Response delete(@RequestParam("opSign") String opSign);

    /**
     * 获取上周到后五周的计划数据
     *
     * @return
     */
    @PostMapping("/api/v1/salesPlanOther/getLastWeekByType")
    Response<List<SalesWriteDTO>> getLastWeekByType();
}
